import Vue from 'vue'
import Router from 'vue-router'
// 一级路由
// import HelloWorld from '@/components/HelloWorld'
const home = () =>import('../pages/Home/home.vue')
const category = () =>import('../pages/Category/category.vue')
const cart = () =>import('../pages/Cart/cart')
const me = () =>import('../pages/Me/me.vue')

Vue.use(Router)

export default new Router({
  routes: [
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   // component: HelloWorld
    //   component: (resolve)=>require(['@/pages/HelloWorld'],resolve)
    // },
    // {
    //   path: '/Home',
    //   name: 'Home',
    //   // component: HelloWorld
    //   component: (resolve)=>require(['@/pages/Home'],resolve)
    // }
    {
      path:'/',
      redirect:'home'
    },{
      path:'/home',
      component:home
    },{
      path:'/category',
      component:category
    },{
      path:'/cart',
      component:cart
    },{
      path:'/me',
      component:me
    }
  ]
})
